1
|
|
|
import {Entity, Column, PrimaryGeneratedColumn} from 'typeorm'; |
2
|
|
|
|
3
|
|
|
export enum ContractType { |
4
|
|
|
CDI = 'cdi', |
5
|
|
|
CDD = 'cdd', |
6
|
|
|
CTT = 'ctt', |
7
|
|
|
APPRENTICESHIP = 'apprenticeship', |
8
|
|
|
PROFESSIONALIZATION = 'professionalization' |
9
|
|
|
} |
10
|
|
|
|
11
|
|
|
@Entity() |
12
|
|
|
export class UserAdministrative { |
13
|
|
|
@PrimaryGeneratedColumn('uuid') |
14
|
|
|
private id: string; |
15
|
|
|
|
16
|
|
|
@Column({type: 'timestamp', nullable: false}) |
17
|
|
|
private joiningDate: string; |
18
|
|
|
|
19
|
|
|
@Column({type: 'timestamp', nullable: true}) |
20
|
|
|
private leavingDate: string; |
21
|
|
|
|
22
|
|
|
@Column({type: 'integer', nullable: false}) |
23
|
|
|
private annualEarnings: number; |
24
|
|
|
|
25
|
|
|
@Column({type: 'integer', default: 0, nullable: true}) |
26
|
|
|
private transportFee: number; |
27
|
|
|
|
28
|
|
|
@Column({type: 'boolean', nullable: false}) |
29
|
|
|
private healthInsurance: boolean; |
30
|
|
|
|
31
|
|
|
@Column({type: 'boolean', nullable: false}) |
32
|
|
|
private executivePosition: boolean; |
33
|
|
|
|
34
|
|
|
@Column('enum', {enum: ContractType, nullable: false}) |
35
|
|
|
private contract: ContractType; |
36
|
|
|
|
37
|
|
|
constructor( |
38
|
|
|
annualEarnings: number, |
39
|
|
|
healthInsurance: boolean, |
40
|
|
|
executivePosition: boolean, |
41
|
|
|
contract: ContractType, |
42
|
|
|
joiningDate: string, |
43
|
|
|
leavingDate?: string, |
44
|
|
|
transportFee?: number |
45
|
|
|
) { |
46
|
|
|
this.annualEarnings = annualEarnings; |
47
|
|
|
this.healthInsurance = healthInsurance; |
48
|
|
|
this.executivePosition = executivePosition; |
49
|
|
|
this.contract = contract; |
50
|
|
|
this.joiningDate = joiningDate; |
51
|
|
|
this.leavingDate = leavingDate; |
52
|
|
|
this.transportFee = Math.round(transportFee * 100); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public getId(): string { |
56
|
|
|
return this.id; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public getJoiningDate(): string { |
60
|
|
|
return this.joiningDate; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public getLeavingDate(): string { |
64
|
|
|
return this.leavingDate; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
public getAnnualEarnings(): number { |
68
|
|
|
return this.annualEarnings; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public getTransportFee(): number { |
72
|
|
|
return this.transportFee / 100; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
public haveHealthInsurance(): boolean { |
76
|
|
|
return this.healthInsurance; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public isExecutivePosition(): boolean { |
80
|
|
|
return this.executivePosition; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
public getContract(): ContractType { |
84
|
|
|
return this.contract; |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|